﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Snowdreamist.Prism.Region
{
	/// <summary>
	/// 重复视图名称定义异常
	/// </summary>
	public class DuplicatedViewDeclareNameFoundedException:Exception
	{
		public DuplicatedViewDeclareNameFoundedException() { }
		public DuplicatedViewDeclareNameFoundedException(string typeName) : base(string.Format("Duplicated ViewDeclareName of type {0} founded",typeName)) { }
		public DuplicatedViewDeclareNameFoundedException(string[] typeName)
		{
			StringBuilder builder = new StringBuilder(1024);
			builder.Append("Duplicated ViewDeclareName of types");
			builder.Append(Environment.NewLine);
			if (typeName == null || typeName.Length == 0)
				builder.Append("Unknown");
			else
				foreach (var x in typeName)
				{
					builder.Append(x);
					builder.Append(Environment.NewLine);
				}
			builder.Append("founded");
		}
		public DuplicatedViewDeclareNameFoundedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
	}
}
